package com.tzu.ssl;

/**
 * -dname 拥有者信息，CN：姓名；OU：组织单位名称；O：组织名称；L：市/自治区名称；ST：省；C：国家/地区代码
 */
public class  KeyInfo {
    //姓名
    private String common = "ft";
    //组织单位名称
    private String orgUnit = "ht304";
    //组织名称
    private String org = "casic";
    //城市
    private String city = "beijing";
    //省
    private String state = "beijing";
    //国家
    private String country = "CN";
    //密钥长度，默认1024
    private int keysize = 1024;
    //有效期：秒，默认30天
    private long validity = 30 * 24 * 60 * 60;
    //证书名称
    private String alias;
    //密码
    private String keypass;
    //加密算法，默认RSA
    private String keyalg = SSLTools.SignAlgo.RSA;
    //签名和算法
    private String signAlgo;

    //密钥库存储路径
    private String keyStorePath;
    //密钥库存储路径
    private String trustStorePath;
    //私钥保存路径
    private String privatePath;
    //公钥保存路径
    private String publicPath;
    //证书保存路径
    private String certPath;
    //协议版本
    private String sslVersion = SSLTools.SSLVersion.TLS_V12;
    //密钥库类型，默认JKS
    private String keyStoreType;

    public KeyInfo() {
    }

    public KeyInfo(String alias, String keypass, String keyStorePath) {
        this.alias = alias;
        this.keypass = keypass;
        this.keyStorePath = keyStorePath;
    }

    public KeyInfo(String alias, String keypass, String keyalg, String signAlgo, int keysize, String keyStorePath, String keyStoreType) {
        this.alias = alias;
        this.keypass = keypass;
        this.keyalg = keyalg;
        this.keysize = keysize;
        this.signAlgo = signAlgo;
        this.keyStorePath = keyStorePath;
        this.keyStoreType = keyStoreType;
    }


    public String getCommon() {
        return common;
    }

    public void setCommon(String common) {
        this.common = common;
    }

    public String getOrgUnit() {
        return orgUnit;
    }

    public void setOrgUnit(String orgUnit) {
        this.orgUnit = orgUnit;
    }

    public String getOrg() {
        return org;
    }

    public void setOrg(String org) {
        this.org = org;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public int getKeysize() {
        return keysize;
    }

    public void setKeysize(int keysize) {
        this.keysize = keysize;
    }

    public long getValidity() {
        return validity;
    }

    public void setValidity(long validity) {
        this.validity = validity;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getKeypass() {
        return keypass;
    }

    public void setKeypass(String keypass) {
        this.keypass = keypass;
    }

    public String getKeyalg() {
        return keyalg;
    }

    public void setKeyalg(String keyalg) {
        this.keyalg = keyalg;
    }

    public String getPrivatePath() {
        return privatePath;
    }

    public void setPrivatePath(String privatePath) {
        this.privatePath = privatePath;
    }

    public String getPublicPath() {
        return publicPath;
    }

    public void setPublicPath(String publicPath) {
        this.publicPath = publicPath;
    }

    public String getSslVersion() {
        return sslVersion;
    }

    public void setSslVersion(String sslVersion) {
        this.sslVersion = sslVersion;
    }

    public String getKeyStorePath() {
        return keyStorePath;
    }

    public void setKeyStorePath(String keyStorePath) {
        this.keyStorePath = keyStorePath;
    }

    public String getKeyStoreType() {
        return keyStoreType;
    }

    public void setKeyStoreType(String keyStoreType) {
        this.keyStoreType = keyStoreType;
    }

    public String getSignAlgo() {
        return signAlgo;
    }

    public void setSignAlgo(String signAlgo) {
        this.signAlgo = signAlgo;
    }

    public String getCertPath() {
        return certPath;
    }

    public void setCertPath(String certPath) {
        this.certPath = certPath;
    }

    public String getTrustStorePath() {
        return trustStorePath;
    }

    public void setTrustStorePath(String trustStorePath) {
        this.trustStorePath = trustStorePath;
    }
}
